package com.cloud.pole.common.util.jwt;

import java.io.Serializable;

/**
 * Created by ace on 2017/9/10.
 */
public class JWTInfo implements Serializable, IJWTInfo {
	public static final int USER_TYPE_ADMIN  	  = 10;    //管理用户
	public static final int USER_TYPE_BASE   	  = 20;    //前端用户(注册)
	public static final int USER_TYPE_MERCHANTT   = 30;    //商城商户
	
	public static final int USER_TYPE_CLINET = 1000;   //微服务

    private String userId;
    private String username;
    private String nickName;
    private String realName;
    
    private int userType;
    private String userAttr1;
    private String userAttr2;
    private String userAttr3;
    private String userAttr4;

    public JWTInfo(String username, int userType, String userId, String nickName, String realName) {
        this.username = username;
        this.userId = userId;
        this.nickName = nickName;
        this.userType = userType; 
        this.realName = realName;
    }

    @Override
    public String getUniqueName() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Override
    public String getId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Override
    public String getNickName() {
        return nickName;
    }
    
    public int getUserType() {
		return userType;
	}

	public void setUserType(int userType) {
		this.userType = userType;
	}
	
	@Override
	public int getType() {
		// TODO Auto-generated method stub
		return userType;
	}
	
	@Override
	public String getAttr1() {
		// TODO Auto-generated method stub
		return this.userAttr1;
	}

	@Override
	public String getAttr2() {
		// TODO Auto-generated method stub
		return this.userAttr2;
	}

	@Override
	public String getAttr3() {
		// TODO Auto-generated method stub
		return this.userAttr3;
	}

	@Override
	public String getAttr4() {
		// TODO Auto-generated method stub
		return this.userAttr4;
	}

	public String getUserAttr1() {
		return userAttr1;
	}

	public void setUserAttr1(String userAttr1) {
		this.userAttr1 = userAttr1;
	}

	public String getUserAttr2() {
		return userAttr2;
	}

	public void setUserAttr2(String userAttr2) {
		this.userAttr2 = userAttr2;
	}

	public String getUserAttr3() {
		return userAttr3;
	}

	public void setUserAttr3(String userAttr3) {
		this.userAttr3 = userAttr3;
	}

	public String getUserAttr4() {
		return userAttr4;
	}

	public void setUserAttr4(String userAttr4) {
		this.userAttr4 = userAttr4;
	}

	@Override
	public String getName() {
		// TODO Auto-generated method stub
		return this.realName;
	}
}
